package com.imooc.sell.converter;

import com.imooc.sell.dataobject.OrderMaster;
import com.imooc.sell.dto.OrderDTO;
import org.springframework.beans.BeanUtils;
import org.springframework.data.domain.Page;

import java.util.ArrayList;
import java.util.List;

public class OrderMaster2OrderDTOConverter {

    public static List<OrderDTO> convert(List<OrderMaster> list){
        ArrayList<OrderDTO> orderdtoList = new ArrayList<>();
        for (OrderMaster orderMaster : list) {
            OrderDTO orderDTO = new OrderDTO();
            BeanUtils.copyProperties(orderMaster,orderDTO);
            orderdtoList.add(orderDTO);
        }

        return  orderdtoList;
    }
}
